<div class='fui-page fui-page-current' ng-if="pagedata.op=='list'">
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">角色管理</div>
        <div class="fui-header-right">
          
        </div>
    </div>
    <div class='fui-content' style="margin-top:2.5rem">
		<div style="padding:0.5rem;">
			<!-- 角色列表 -->
		   <div ng-repeat="item in pagedata.list" class="fui-cell-group" style="margin-top:0">
			   <div class="fui-cell">
					<div class="fui-cell-info">
						<div class="title">{{item.name}}</div>
						<div class="subtitle">
							<span class="label {{item.status==1?'label-success':'label-default'}}">{{item.statustitle || '无'}}</span>
						</div>
					</div>
					<div class="fui-cell-remark noremark">
						<div class="btn btn-sm btn-warning-o order-delete" href="javascript:;" ng-click="access_json('/manage.salergroup/edit/id='+item.id);">编辑</div>
						<div class="btn btn-sm btn-default-o order-delete" href="javascript:;" ng-click="post({},'/manage.salergroup/del/','id='+item.id,'','确认删除吗？')">删除</div>
					</div>
				</div>
			</div>
			<div class="content-empty" ng-show="(!pagedata.list || pagedata.list.length == 0) && !pagedata.loading">
			  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没有角色！</p>
			</div>
			 <div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
			 <div class="c" style="padding-top:1rem">
				<a href="javascript:;" ng-click="access_json('/manage.salergroup/edit/')" class='btn btn-sm btn-danger-o external'style="border-radius: 100px;width:  7rem;font-size: .75rem">添加角色</a>
			 </div>
		</div>
	</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='edit'">
 <div class='fui-content'>
	<div style="padding:0.5rem;">
		<div class="weui_cells" style="margin-top:0.5rem">
			<div class="weui_cell weui_cells_form ng-scope">
				<div class="weui_cell_hd"><label class="weui_label}" class="weui_label">角色名称</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input class="weui_input" type="text" ng-model="pagedata.item.name" placeholder="请输入角色名称">
				</div>
			</div>
			<div class="weui_cell weui_cell_select ng-scope">
							<div class="weui_cell_hd">
								选择所属门店
							</div>
							<div class="weui_cell_bd weui_cell_primary">
								<select class="weui_select" ng-model="pagedata.item.storeid">
									<option ng-repeat="op in pagedata.store" value="{{op.id}}" ng-selected="pagedata.item.storeid==op.id">{{op.title}}</option>
								</select>
							</div>
			</div>
		</div>
		<div class="weui_cells_title right-label">选择掌上权限</div>
		<div class="weui_cells weui_cells_checkbox" style="padding:0.5rem">
			<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(value,dtitle) in pagedata.perm_mobile">
				<input ng-click="duoxuans(value,pagedata.item,'perms_mobile')" type="checkbox" ng-checked="pagedata.item.perms_mobile.indexOf(';'+value+';')>=0" class="fui fui-checkbox fui-checkbox-danger verify-checkbox"> {{dtitle}}
			</div>
		</div>
		<div class="weui_cells_title">状态</div>
		<div class="weui_cells weui_cells_radio"  style="padding:0.5rem">
			<div class="fui-cell-label" for="radio-status-0" ng-repeat="(value,dtitle) in pagedata.status" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
				<input type="radio" ng-model="pagedata.item.status" id="radio-status-0" class="fui fui-radio fui-radio-danger verify-radio" value="{{value}}"> {{dtitle}}
			</div>
	</div>
	</div>
	<div class="modal-sub" style="padding-top:1rem">
		<button class="weui_btn weui_btn_primary ng-binding" style="border-radius:1rem;" ng-click="check_form();post(pagedata.item,'post')">提交</button>
	</div>
 </div>
</div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.loading = true;
var page = 1;
var keyword = '';
scope.tool.get_list('jy_shopwms/manage.salergroup/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_shopwms/manage.salergroup/list/');
}
   
</script>
